Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presigned url 적용 #147

Merged
merged 14 commits into from
Nov 30, 2023
Merged

presigned url 적용 #147

merged 14 commits into from
Nov 30, 2023

Conversation

5tarry
Copy link
Collaborator

@5tarry 5tarry commented Nov 30, 2023

resolved: #146

작업 내용

  • 프로필/광고 이미지 업로드 하는 url 반환 api
  • 프로필 조회 api 수정
  • 회원가입 api 수정
  • 썸네일/프로필 이미지 가져오는 url 재발급 api
  • 비디오 업로드 api 수정
  • 랜덤 비디오 응답, 썸네일 클릭 시 비디오 정보 반환, 인기 비디오, 카테고리 탑10 api 수정
  • 프로필 변경 api 수정

@5tarry 5tarry added backend feat 새로운 기능 추가 refactor 코드 리팩토링 labels Nov 30, 2023
@5tarry 5tarry requested a review from msjang4 November 30, 2023 01:21
@5tarry 5tarry self-assigned this Nov 30, 2023
msjang4
msjang4 previously approved these changes Nov 30, 2023
Copy link
Collaborator

@msjang4 msjang4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

귀찮고 헷갈리는 작업 많았을텐데 넘 잘해주셨네요~!! 👍

@@ -15,7 +15,7 @@ export class AppController {
/**
* 광고 이미지 응답
*/
@ApiTags('COMPLETE')
@ApiTags('LEGACY')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LEGACY 태그로 기존 코드 구분하신게 좋은거 같아요!

Comment on lines +3 to +4
* 특정 광고 이미지의 presigned url만 받고 싶은 경우
* @example 'test.webp'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 45 to 51
(
await createPresignedUrl(
process.env.INPUT_BUCKET,
`${videoId}.${videoExtension}`,
'PUT',
)
).url,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래 코드는 어떠신가요?

 createPresignedUrl(
     process.env.INPUT_BUCKET,
     `${videoId}.${videoExtension}`,
     'PUT',
).then( data=> data.url)

new HttpRequest({ ...url, method }),
{ expiresIn: 100 },
);
return { name: objectName, url: formatUrl(signedUrlObject) };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url만 리턴하는게 자연스러울거 같은데 name을 같이 리턴해야만 하는 이유가 있을까요?
이 함수를 호출하는 코드에서도 url만 사용하는 경우가 있는 것 같아서요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

광고 이미지를 재발급 받으려면 name이 필요한데 서비스에서 추가하기 귀찮아서 이렇게 했습니다..!

)
).url
: null;
if (profileDto.profileExtension === '' && user.profileImageExtension) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'profileImage' in profileDto 보다 직관적이네요 좋습니다

Comment on lines +84 to +86
const result = (
await this.UserModel.findOneAndUpdate({ uuid }, updateOption)
).toObject();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아마 toObject()를 lean:true로 대체할 수 잇을거같아요~

Comment on lines 80 to 81
videoInfo.thumbnailExtension
? (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

썸네일 확장자는 무조건 있을 거라 삼항연산이 필요 없을 거 같긴하네요~

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 그러네요

Copy link
Collaborator

@msjang4 msjang4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 반영 감사합니다 🙇🏻‍♂️

@msjang4 msjang4 merged commit c1775e2 into develop Nov 30, 2023
@msjang4 msjang4 deleted the feat/presigned_url branch November 30, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend feat 새로운 기능 추가 refactor 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Backend] Presigned Url
2 participants